package com.foreknow.elmboot.mapper;

import com.foreknow.elmboot.po.Business;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
//@Mapper:表示mybatis的操作要交给Spring来管理
@Mapper
public interface BusinessMapper {
    /**
     * 根据分类的编号查询商家信息
     * @param orderTypeId 分类的编号
     * @return List集合
     * @throws Exception
     */
    @Select("select * from business where orderTypeId=#{orderTypeId} order by businessId")
    public List<Business> listBusinessByOrderTypeId(Integer orderTypeId);

    /**
     * 根据商家的编号查询商家的信息
     * @param businessId
     * @return Business对象
     * @throws Exception
     */
    @Select("select * from business where businessId=#{businessId}")
    public Business getBusinessById(Integer businessId);
}
